Centos_下载Google drive上的文件
1.下载小文件
wget --no-check-certificate ‘https://docs.google.com/uc?export=download&id=FILEID’ -O FILENAME
替换对应的FILEID即可,FILENAME自己命名。
FILEID是Google drive公开分享的链接中ID后面的,例如:
https://drive.google.com/open?id=ThisIsFileID
如果下载中断了,想要继续下载,可以在wget后面添加 -c 参数
2.下载大文件
因为Google drive的大文件,无法通过安全查杀
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt
同样替换其中的FILEID和FILENAME即可。注意FILEID有两处。
3.使用脚本下载
wget https://raw.githubusercontent.com/circulosmeos/gdown.pl/master/gdown.pl
chmod +x gdown.pl
./gdown.pl "Google Drive 文件地址" "保存的文件名"
Editing is enabled. Use the "Save changes" button below the editor to commit modifications to this file.